package com.zzl.bonds.ticket.constant.status;

/**
 * 票据状态 0 蓝色，1绿色，2黄色，3灰色
 *
 * @author : gull
 * @date : 2022/3/1 14:04
 */
public enum FlowChartColourEnum {

    /**
     * 全部
     */
    BLUE("0", "蓝色"),
    GREEN("1", "绿色"),
    YELLOW("2", "黄色"),
    GREY("3", "灰色"),
    ;

    private String code;
    private String name;


    FlowChartColourEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }


    /**
     * 通过code获取枚举对象
     *
     * @param code code值
     * @return 枚举对象
     */
    public static String getStatusName(String code) {
        for (FlowChartColourEnum value : FlowChartColourEnum.values()) {
            if (value.code.equals(code)) {
                return value.name;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
